feat(data-table): add filter policy support - #431
Closed
IzumiSy wants to merge 6 commits into
Closed
Conversation
IzumiSy
force-pushed
the
feat/data-table-filter-policy
branch
from
August 18, 2026 00:39
f52c32e to
cbe5f8d
Compare
Contributor
Author
|
/review |
Contributor
|
✅ API Design Review completed successfully! |
Contributor
There was a problem hiding this comment.
Generated by API Design Review for issue #431 · 59.9 AIC · ⌖ 6.18 AIC · ⊞ 5.8K
Comment /review to run again
Contributor
Author
|
/review |
Contributor
|
✅ Code Review completed successfully! Code review complete. Both previously raised issues (Medium: silent caseSensitive shape change; Low: empty interface extension) have been resolved by the author. No new High or Medium issues found. Verdict: Approve — the filterPolicy implementation is correct, backward-compatible, and well-tested. |
Contributor
Code Metrics Report
Details | | main (7a727b1) | #431 (5288147) | +/- |
|---------------------|----------------|----------------|-------|
+ | Coverage | 90.0% | 90.0% | +0.0% |
| Files | 125 | 125 | 0 |
| Lines | 5165 | 5183 | +18 |
+ | Covered | 4650 | 4668 | +18 |
- | Test Execution Time | 1m47s | 1m55s | +8s |Code coverage of files in pull request scope (80.4% → 80.9%)
Reported by octocov |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Some backends only expose a subset of the DataTable filter surface. In particular, operator support can vary per field type, and regex-backed case-insensitive string filtering may be unavailable. Without a way to express those limits, inferred filter UIs could offer controls that the backend cannot execute, and URL-backed filter state could restore unsupported operators.
Design Decision
Chosen approach
Expose backend-wide filter defaults through
filterPolicy, applied where metadata-derivedFilterConfigobjects are created.This keeps the main override point close to
inferColumns()andfieldTypeToFilterConfig(), which already translate metadata into filter behavior. The resolvedFilterConfigthen drives both the visible filter UI and URL-state hydration.URL state behavior
useURLCollectionVariables()andwithURLCollectionState()now accept the samefilterPolicyso URL hydration validates operators against the effective filter config.For string filters, URL hydration restores the field's default case-sensitivity from
supportsCaseInsensitiveinstead of adding a new URL format for that flag.Alternatives considered
A control-level capability API was considered, but that would push backend policy into runtime control wiring for a case that is usually static per app/backend. A metadata/inference-level policy keeps the common path smaller and avoids extra wrapper code for each table.
Summary
operatorsandsupportsCaseInsensitivetoFilterConfig, plus publicFilterPolicysupport in metadata-derived filter config helpersinferColumns()to apply backend-wide filter policy defaults to inferred filter configs